package com.llkj.qingnianguoxue.adapter;

import android.widget.ImageView;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chauthai.swipereveallayout.SwipeRevealLayout;
import com.llkj.qingnianguoxue.R;
import com.llkj.qingnianguoxue.bean.InviteFriendBean;
import com.llkj.qingnianguoxue.bean.MyFriendListBean;
import com.llkj.qingnianguoxue.http.HttpMethod;
import com.llkj.qingnianguoxue.util.ImageLoadingUtil;

import java.util.List;

/**
 * 邀请好友
 */
public class InviteFriendsAdapter extends BaseQuickAdapter<InviteFriendBean, BaseViewHolder> {

    public InviteFriendsAdapter(int layoutResId, List<InviteFriendBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder,InviteFriendBean item) {
        baseViewHolder.setText(R.id.tv_name,item.getUsername());
        ImageView ivHead = baseViewHolder.getView(R.id.iv_head);
        String picUrl = item.getUserpic();
        if(!picUrl.startsWith("http://")){
            picUrl = HttpMethod.PRE_PIC + picUrl;
        }
        ImageLoadingUtil.loadingImg(ivHead,picUrl,0);
    }

}
